package com.test.resulttofront.service;

import com.test.resulttofront.ErrorResult;
import com.test.resulttofront.entity.Order;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class OrderService {
    public Order getOrderById(Integer id) {
        System.out.println("根据id查找订单");
        if (id == 100) {
            throw new ErrorResult(50005, new NullPointerException("参数无效"));
        }
        return new Order(id, "手机订购单", new Date());
    }
}
